package com.bvgol.examples.dubbo.zk.util;

import java.io.Serializable;

public class ServiceResult<T> implements Serializable {
    private static final long serialVersionUID = 3765720967319047788L;
    private T result;
    private PagerInfo pagerInfo;
    private boolean success = true;
    private String message = "";
    private String code = "";

    public ServiceResult() {
    }

    public boolean getSuccess() {
        return this.success;
    }

    public void setSuccess(boolean isSuccess) {
        this.success = isSuccess;
    }

    public void setResult(T result) {
        this.result = result;
    }

    public void setError(String code, String message) {
        this.code = code;
        this.message = message;
        this.success = false;
    }

    public String getCode() {
        return this.code;
    }

    public T getResult() {
        return this.result;
    }

    public String getMessage() {
        return this.message;
    }

    public void setMessage(String value) {
        this.message = value;
    }

    public PagerInfo getPager() {
        return this.pagerInfo;
    }

    public void setPager(PagerInfo pager) {
        this.pagerInfo = pager;
    }

    public String toString() {
        return "[result=" + this.result + ", message=" + this.message + ", success=" + this.success + ", code=" + this.code + "]";
    }
}
